package cn.gzjp.modules.rice.service;

import java.util.List;

import cn.gzjp.modules.logis.entity.LogisUser;
import cn.gzjp.modules.wx.entity.WxMpAccount;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gzjp.common.persistence.Page;
import cn.gzjp.common.service.CrudService;
import cn.gzjp.modules.rice.entity.RiceMember;
import cn.gzjp.modules.rice.dao.RiceMemberDao;

/**
 * 会员管理Service
 * @author zengcp
 * @version 2018-11-17
 */
@Service
@Transactional(readOnly = true)
public class RiceMemberService extends CrudService<RiceMemberDao, RiceMember> {

	public RiceMember get(String id) {
		return super.get(id);
	}
	
	public List<RiceMember> findList(RiceMember riceMember) {
		return super.findList(riceMember);
	}
	
	public Page<RiceMember> findPage(Page<RiceMember> page, RiceMember riceMember) {
		return super.findPage(page, riceMember);
	}
	
	@Transactional(readOnly = false)
	public void save(RiceMember riceMember) {
		RiceMember m = get(riceMember.getId());
		if(m!=null){
			super.save(riceMember);
		}else{
			super.insert(riceMember, riceMember.getId());
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(RiceMember riceMember) {
		super.deleteByLogic(riceMember);
	}
	
}